Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
The get-stdin package is a simple utility that allows you to easily read stdin as a string or buffer in Node.js. It's useful for command-line tools that need to process input piped to them from the command line.
Read stdin as a string
This feature allows you to read the standard input (stdin) as a string. It returns a promise that resolves with the entire input when the stdin stream ends.
const getStdin = require('get-stdin');
getStdin().then(input => {
console.log(input);
});
Read stdin as a buffer
This feature allows you to read the standard input (stdin) as a buffer. It returns a promise that resolves with the entire input as a buffer when the stdin stream ends.
const getStdin = require('get-stdin');
getStdin.buffer().then(input => {
console.log(input);
});
The raw-body package is similar to get-stdin but is more focused on parsing HTTP request bodies and provides more options for limiting size, setting character encoding, and handling errors.
Concat-stream is a writable stream that concatenates all the data from a stream and calls a callback with the result. It can be used in a similar way to get-stdin for collecting stream data, but it is not limited to stdin and does not return a promise.
Get-stream is a utility that turns a stream into a string or buffer. It is very similar to get-stdin but works with any stream, not just stdin, and offers more options for handling the stream data.
Easier stdin
$ npm install --save get-stdin
// example.js
var stdin = require('get-stdin');
stdin(function (data) {
console.log(data);
//=> unicorns
});
$ echo unicorns | node example.js
unicorns
MIT © Sindre Sorhus
FAQs
Get stdin as a string or buffer
The npm package get-stdin receives a total of 15,962,623 weekly downloads. As such, get-stdin popularity was classified as popular.
We found that get-stdin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.